package com.xiaosu.red_travel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaosu.red_travel.dao.UserDao;
import com.xiaosu.red_travel.mapper.User;
import com.xiaosu.red_travel.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService {
    /**
     * 用户登录
     * @param user
     * @return
     */
    @Override
    public User login(User user) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username",user.getUsername());
        queryWrapper.eq("password", user.getPassword());
        return getOne(queryWrapper);
    }
}
